package net.hn.hnms.biz.mine.company.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import net.hn.hnms.biz.api.mine.model.ConnectionCountVO;
import net.hn.hnms.biz.api.mine.model.ConnectionState;
import net.hn.hnms.biz.mine.company.service.CompanyService;
import net.hn.hnms.biz.mine.company.service.RatingSortService;
import net.hn.hnms.biz.mine.vo.ScoreVO;
import net.hn.hnms.sys.common.core.domain.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 智呈物联 pan'sx
 * 2022/12/26 8:33
 * 1.0 version
 */
@RestController
@RequestMapping("company")
@Api(value = "公司端相关接口", tags = {"公司端相关接口"})
@RequiredArgsConstructor
public class CompanyController {
    private final CompanyService companyService;
    private final RatingSortService ratingSortService;

    @GetMapping("connectionState")
    @ApiOperation("联网情况")
    public R<List<ConnectionState>> connectionState(@ApiParam(value = "系统编码，如aqjk、zdsb、jxry",required = true) String schema) {
        return R.ok(companyService.connectionState(schema));
    }

    @GetMapping("fireRatingSort")
    @ApiOperation("火灾评分")
    public R<List<ScoreVO>> fireRatingSort(){
        return R.ok(ratingSortService.fireRatingSort());
    }

    @GetMapping("connectionCount")
    @ApiOperation("联网概况")
    public R<List<ConnectionCountVO>> connectionCount() {
        return R.ok(companyService.connectionCount());
    }
}
